import urllib.parse

# urlencode应用场景：多个参数的时候

url = 'https://www.baidu.com/s?wd=周杰伦&sex=男'

data = {
    'wd': '周杰伦',
    'sex': '男'
}

data_new = urllib.parse.urlencode(data)

print(data_new)


